﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public static Dictionary<string, string> users = new Dictionary<string, string>();
        private void labell_Click(object sender,EventArgs e)
        {

        }
        private void textBox1_TextChanged(object sender,EventArgs e)
        {

        }


        private void buttonl_Click(object sender,EventArgs e)
        {
            var uid = TextBox1.Text;
            var pwd = TextBox2.Text;
            var user = users.Where < (XmlReadMode => XmlReadMode.key == uid && x.Value == pwd).FirstOrDefault();



            if(user.Key !=null && user.Value != null)
            {
                MessageBox.Show("登录成功");
                Form2 form2 = new Form2();
                this.Hide();
                form2.Show();
            }
            else
            {
                MessageBox.Show("登录失败");
            }

        }

        private void button2_Click(object sender,EventArgs e)
        {
            Form3 form3 = new Form3();
            Form3.Show();
        }

        private void Form1_Load(object sender,EventArgs e)
        {
            users.Add("hehe", "123");
            users.Add("xixi", "456");
        }
    }
}
